package com.dh.spring.thread;

import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;

/**
 * 线程池任务阻塞队列功能接口
 * */
public interface CustomTaskBlockQueue {

    //TODO 提交Runnable任务
    void offerRunnable(Runnable runnable, CustomThreadPool customThreadPool, CustomAbortPolicy customAbortPolicy);

    //TODO 提交Callable任务
    boolean offerCallable(FutureTask<Callable> futureTask, CustomThreadPool customThreadPool, CustomAbortPolicy customAbortPolicy);

    //TODO 取出Runnable任务
    Runnable takeRunnable();

    //TODO 取出Callable任务;
    FutureTask<Callable> takeCallable();

    //TODO 获取Runnable任务阻塞队列的是否为空
    boolean getRunnableTaskBlockQueueIsEmpty();

    //TODO 获取Callable任务阻塞队列是否为空
    boolean getCallableTaskBlockQueueIsEmpty();

    //TODO 获取Runnable任务阻塞队列的大小
    int getRunnableTaskBlockQueueSize();

    //TODO 获取Callable任务阻塞队列是否大小
    int getCallableTaskBlockQueueSize();

}
